#ifndef OBJECT_H
#define OBJECT_H

#ifndef GENESIS_DATATYPES
#define GENESIS_DATATYPES
typedef unsigned char byte;
typedef unsigned short word;
#endif

void pcObjectMethods();
void ExecuteObjects();




    union object
    {
        struct { 
        byte ID;
        byte Render;
        word Gfx;   //pointer to VRAM in ROM, since vram is emulated refer to offset as normal word(non-pointer)
        byte **Map;  //long pointer in ROM
        union { long Xdec; struct { word ScreenY; word X; }; };
	union { long Ydec; struct { word Yfract; word Y; }; };
	union { signed short VelocityX; struct { byte VelocityXfract; byte VelocityXdist; }; };
	union { signed short VelocityY; struct { byte VelocityYfract; byte VelocityYdist; }; };
		signed short Inertia;
		byte Height;
		byte Width;
		byte Priority;
		byte ActionWidth;
		byte Frame;
		byte AniFrame;
		byte Anim;
		byte NextAni;
		signed char TimeFrame;
		byte DelayAni;
		byte ColType;
		byte ColProp;
		byte Status;
		byte RespawnNo;
		byte Routine;
		byte secondRoutine;
		signed short Angle;
		byte Subtype;
		byte *Solid;
		byte Variables[24];
		void init(byte i) {  ID=i; }
		bool exists() { return (ID != 0); }
		bool empty() { return (ID == 0); }
		object() { ID=0; }
        };
        byte bytes[64];
    };            		


void ObjectFall(object *obj);


#endif
